package resilienceManager.qmul.gemom;
import java.lang.*;
import java.util.Iterator;
import java.util.Vector;

/**
 * The Item class used for the Item auction
 * saved all the namespace set
 * 
 * COPYRIGHT DISCLAIMER
 * Synopsis: All the source codes presented in this document are intellectual
 * properties of Queen Mary, University of London.
 * 
 * @year 2010
 * @author Peng Jiang, John Bigham, Jiayi Wu Jinfu Wang------------QMUL
 * @version 1.0 
 */


// one item! not all items
public class NSitem {
	
	public Vector<Integer> nslist;
//	what is the gid???
	private int Gid;
//	item ID
	private int nsID; 
	
	
	public NSitem(int id){
		this.nsID=id;
		this.nslist=new Vector<Integer>();
	}
	
	public void addNS(int nsid)
	{
		this.nslist.add(nsid);
	}
	
	public int getID()
	{
		return this.nsID;
	}
	
	public Vector<Integer> getNSlist()
	{
		return this.nslist;
	}
	
	public int getSize(){
		
		return this.nslist.size();
	}

	public double Rate() {
		double rate=0;
		for (Iterator<Integer> i = nslist.iterator(); i.hasNext();){
//FIXME			 get the mean rate of each ns
//			rate = rate + GETFROM DB or has table (i.next());
		}
			
		
		return rate;
	}

}
